Code coverage support for CacheLib#50
Conversation
igchor
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @guptask)
cachelib/CMakeLists.txt line 89 at r1 (raw file):
# Add code coverage set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
Can add an option to enable/disable coverage?
Something like:
if(COVERAGE_ENABLED)
# Add code coverage
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
endif()
|
Previously, igchor (Igor Chorążewicz) wrote…
Done. |
fbcc7eb to
c6598b7
Compare
igchor
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @guptask)
run_code_coverage.sh line 11 at r2 (raw file):
# Track coverage lcov -c -i -b . -d . -o Coverage.baseline
what is this Coverage.baseline? what does it contain if no tests were run?
igchor
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @guptask)
run_code_coverage.sh line 3 at r2 (raw file):
#!/bin/bash BUILD_DIR='build-cachelib'
I'm not sure if you should put compilation/installation step here - it would be better for this script to be standalone.
|
Previously, igchor (Igor Chorążewicz) wrote…
Are you saying it is better to split this into 2 scripts - build_coverage and generate_coverage ? |
|
Previously, igchor (Igor Chorążewicz) wrote…
Even if you don't run unit tests, the coverage report shows non-zero coverage for few files. I'm not sure exactly why that is the case. These commands allow us to include those coverage stats in the final report. |
igchor
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @guptask)
run_code_coverage.sh line 3 at r2 (raw file):
Previously, guptask (Sounak Gupta) wrote…
Are you saying it is better to split this into 2 scripts - build_coverage and generate_coverage ?
I mean, I'm not sure if we need the build script at all. We can just document what flag you need to pass to cmake to enable coverage.
run_code_coverage.sh line 11 at r2 (raw file):
Previously, guptask (Sounak Gupta) wrote…
Even if you don't run unit tests, the coverage report shows non-zero coverage for few files. I'm not sure exactly why that is the case. These commands allow us to include those coverage stats in the final report.
Ok, got it.
Fix issue with "Destorying an unresolved handle"
Packages needed are lcov and genhtml.
Coverage requires addition of new compile and linker flags. It can be encapsulated as an option. Currently it is the hard-coded.
This change is